<template>
	<view class="content">
		<view class="search-bar-wrap">
			<view class="search-bar">
				<uv-icon name="search" color="#ccc" size="28"></uv-icon>
				<uv-input style="width: 100%;" placeholder="班级名称/课程名称" :border="false" v-model="value"
					@change="change"></uv-input>
			</view>
		</view>
		<view class="list">
			<view class="list-item" v-for="(item,index) in list" :key="index" @click="toDetail">
				<view class="fixed-right-icon">
					<uv-icon name="arrow-right"></uv-icon>
				</view>
				
				<text class="name">{{item.name}}</text>
				<view class="info">
					<text class="text" style="margin-right: 10px;">{{item.text1}}</text>
					<uv-tags text="一对一" plain size="mini" type="warning"></uv-tags>
				</view>
				<text class="text">{{item.text2}}</text>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				value: '',
				list: [{
					name:'喜悦大教室2班',
					text1:'08.10喜悦大教室课程',
					text2:'小王老师'
				},
				
				{
					name:'喜悦大教室2班',
					text1:'08.10喜悦大教室课程',
					text2:'小王老师'
				}]
			}
		},
		methods: {
			change(e) {
				console.log('change', e);
			},
			toDetail(){
				uni.navigateTo({
					url:'/pages/class/detail/detail'
				})
			},
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #FFFFFF !important;
	}

	.content {

		.search-bar-wrap {
			padding: 20rpx 40rpx;

			.search-bar {
				display: flex;
				align-items: center;
				width: calc(100% - 40rpx);
				height: 80rpx;
				padding: 8rpx 24rpx;
				border-radius: 16rpx;
				opacity: 0.8;
				background: #F7F7F9;

			}
		}

		.list {
			margin-top: 40rpx;

			&-item {
				position: relative;
				width: 100%;
				height: 190rpx;
				padding: 20rpx 40rpx;
				border-bottom: 1px solid rgba(230, 229, 231, 0.8);
				box-sizing: border-box;
				.info{
					display: flex;
					margin-top: 8rpx;
					line-height: 38rpx;
				}
				.name{
					font-family: PingFang SC;
					font-size: 32rpx;
					font-weight: 500;
					line-height: 38rpx;
					letter-spacing: 0px;
					
					font-variation-settings: "opsz" auto;
				}
				
				.text{
					font-family: PingFang SC;
					font-size: 24rpx;
					font-weight: normal;
					line-height: 38rpx;
					letter-spacing: 0px;
					
					font-variation-settings: "opsz" auto;
					color: #3D3D3D;
					opacity: 0.7;
				}

				.fixed-right-icon {
					position: absolute;
					top: 50%;
					/* 将图标定位到父元素顶部的中间位置 */
					transform: translateY(-50%);
					/* 使用transform属性将图标向上移动自身高度一半的距禿，实现居中效果 */
					right: 40rpx;
					/* 将图标定位到父元素的最右侧 */
					// width: 30px;
					// height: 30px;
					// border: 1px solid red;
				}
			}
		}
	}
</style>